fix(store): replace @ts-ignore with ReduxStoreWithManager casting in store.ts - #66
Conversation
| > ```bash | ||
| > npm_config_python=/path/to/python3.11 yarn install | ||
| > `` | ||
| ### Fixing node-gyp issues with Python 3.12 |
6b63cb4 to
1e7cf12
Compare
|
@AlexanderShenshin, the requested changes have been made PTAL! |
…store.ts Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
bf70466 to
736c530
Compare
|
Hi @aryunewaskar77-art, please check pipeline failure. |
Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
…rovider Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
… type Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
|
@aryunewaskar77-art, does the build work fine for you locally? |
|
Sorry for the trouble sir, but this time I did check in the local and then made the commit. |
|
No worries, thanks. |
|
|
||
| export interface ReduxStoreWithManager extends EnhancedStore<StateSchema> { | ||
| reducerManager: ReducerManager; | ||
| dispatch: ThunkDispatch<StateSchema, ThunkExtraArg, UnknownAction>; |
There was a problem hiding this comment.
Why we want to add this type definition?
As far as I see, we're still using type assertion with "unknown assertion" first (as unknown as ReduxStoreWithManager), so can we say that the issue is actually fixed?
There was a problem hiding this comment.
Yes, the issue is actually fixed because we use a cast once in the "factory" (createReduxStore) so that entire codebase can be clean and type-safe.
There was a problem hiding this comment.
I'd say that cast is a problematic solution by itself and we still need to have a TODO or FIXME comment if we're going to rely on the cast...
Is it possible to resolve typecheck errors without a cast in this case?
There was a problem hiding this comment.
That's a fair point, the cast is a workaround since StateSchema has required properties but delete removes them at runtime. Making keys optional would fix it properly but adds null checks everywhere across selectors and components.
Adding a FIXME comment to flag the debt as suggested - let me know if you'd prefer a different approach.
|
@AlexanderShenshin, my PR have passed all the checks successfully. |
AlexanderShenshin
left a comment
There was a problem hiding this comment.
TODO or FIXME comment for casts is still unaddressed.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughChangesIdentity service store typing
Wallet notification badges
Estimated code review effort: 2 (Simple) | ~15 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: aryunewaskar77-art <aaryaanewaskar@gmail.com>
Signed-off-by: aryunewaskar77-art <aryu.newaskar77@gmail.com>
Signed-off-by: aryunewaskar77-art <aryu.newaskar77@gmail.com>
0609d01 to
a99de3e
Compare
Signed-off-by: Aaryaa Newaskar <aryu.newaskar77@gmail.com>
Summary
Removes the
@ts-ignorebypass instore.tsand replaces it witha proper
ReduxStoreWithManagercast.Problem
The store was using
@ts-ignoreto bypass TypeScript when assigningreducerManagerto the store object:// @ts-ignore
store.reducerManager = reducerManager;
This silences the compiler completely, which is dangerous — any future
changes to the store shape would go undetected.
Fix
Cast the store using the existing
ReduxStoreWithManagerinterfacethat was already defined for this exact purpose:
const store = configureStore({ ... }) as ReduxStoreWithManager;
store.reducerManager = reducerManager;
Notes
in the previously merged PR